package com.qiwx.pigeon.adapter.manager;

import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import com.qiwx.pigeon.fragment.manager.CagemanagerFragment;

import java.util.List;

/**
 * @description
 * @Author qiwx
 * @Date 2020-03-26 10:57
 **/
public class CagePagerAdapter extends FragmentPagerAdapter {

    List<CagemanagerFragment> fragments;

    public CagePagerAdapter(FragmentManager fm, List<CagemanagerFragment> fragments) {
        super(fm);
        this.fragments = fragments;
    }

    @Override
    public int getCount() {
        return fragments == null ? 0 : fragments.size();
    }

    @Override
    public CagemanagerFragment getItem(int position) {
        return fragments.get(position);
    }

    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {
        return position==0?"存栏":"空笼";
    }
}

